#ifndef DATA_H_INCLUDED__
#define DATA_H_INCLUDED__

#include <iostream>
#include <cstdlib>
#include <time.h>

#include <vector>
#include <list>
#include <deque>
#include <algorithm>


#define pmax (50)
#define pmin (30)
#define max(x,y) ((x)>=(y)? (x):(y))

using namespace std;

class data {
private:
	int _nbJobs;
	int _nbStages;
	int _nbMachinesPerStage;
	deque <int> _stimes;
	deque <int> _ptimes;
	deque <int> _etimes;
	deque <int> _jobs;
	deque <int> _stages;
	deque <int> _machines;	
public:
	data( );
	data( int nbJobs, int nbStages, int nbMachinesPerStage);
	int getnbJobs();	
	int getnbStages();
	int getJobs(int i);

	void setJobs( int i, int j);

	void deleteJobs(int i) ;

    void setStimes( int i, int j, int k);
	int getStimes( int i, int j) ;

	void setPtimes( int i, int j, int k);
	int getPtimes( int i, int j) ;

    void setEtimes( int i, int j);
	int getEtimes( int i, int j) ;

	void setMachines( int i, int j, int k );
    int data::getMachines( int i, int j) ;

	void  setnbMachinesPerStage(int k) ;
	int getnbMachinesPerStage() ;
};

class schedule {
private:
	int nbSched;
	int nbStages;
	int nbMachinesPerStage;
	deque <int> ptimes; // processing times
	deque <int> rtimes;
	deque <int> stimes; // start times
	deque <int> etimes; // end times
	int         makespan;
	deque <int> sched;
	deque <int> stages;
	deque <int> machines;	
public:
	schedule( data &md); // Need to initialize schedule manually
//	schedule ( schedule &ms);
	int  getnbSched();	
	int  getnbStages();
	int  getSched(int i);
	void setSched( int i, int j);
	void deleteSched(int i) ;
	void insertBeforSched(int i, int j);
	void insertAfterSched(int i, int j);
	
	void setPtimes( int i, int j, int k);
	int  getPtimes( int i, int j) ;	

	void setStimes( int i, int j, int k);
	int  getStimes( int i, int j);

	void setEtimes( int i, int j, int k);
	int  getEtimes( int i, int j);

	void setRtimes( int i, int j, int k);
	int  getRtimes( int i, int j);


	void setMakespan(int i);
	int  getMakespan();

	void setMachines( int i, int j, int k );
	int  getMachines( int i, int j) ;
	int  getnbMachinesPerStage() ;

	int getMaxWait();
	int getLast();

};

#endif